﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZeroBug.EasyFlow.Core;

namespace ZeroBug.EasyFlow.Communication
{
    [Serializable]
    public class AddressInfo : ICsv
    {
        public string AddressName { get; set; }
        public RegisterType RegisterType { get; set; }
        public DataType DataType { get; set; }
        public int StartAddress { get; set; }
        public int Length { get; set; }
        public SerializableDictionary<string, string> CsvName2Property { get; set; }

        public AddressInfo()
        {
            CsvName2Property = new SerializableDictionary<string, string>();
            CsvName2Property.Add("地址名称", nameof(AddressName));
            CsvName2Property.Add("地址区域", nameof(RegisterType));
            CsvName2Property.Add("数据类型", nameof(DataType));
            CsvName2Property.Add("起始地址", nameof(StartAddress));
            CsvName2Property.Add("数据长度", nameof(Length));
        }
    }
}
